package me.baicai.weixin.identity.repository;

import me.baicai.weixin.entity.config.ShopMenu;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.List;


public interface ShopMenuRepository extends JpaRepository<ShopMenu, Long> {

    List<ShopMenu> findAllByShopId(Integer id);

    @Transactional
    @Modifying
    @Query("update ShopMenu set price = ?1 ,use = ?2 where  id = ?3" )
    int updateData(float p, int use, int id);

    ShopMenu getById(Integer id);


}
